package com.zufe.khw;

public class Student{
    private String name;
    private int age;
    private int chineseScore;
    private int mathScore;
    private int englishScore;

    public Student() {
    }

    public Student(String name, int age, int chineseScore, int mathScore, int englishScore) {
        this.name = name;
        this.age = age;
        this.chineseScore = chineseScore;
        this.mathScore = mathScore;
        this.englishScore = englishScore;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return age
     */
    public int getAge() {
        return age;
    }

    /**
     * 设置
     * @param age
     */
    public void setAge(int age) {
        this.age = age;
    }

    /**
     * 获取
     * @return chineseScore
     */
    public int getChineseScore() {
        return chineseScore;
    }

    /**
     * 设置
     * @param chineseScore
     */
    public void setChineseScore(int chineseScore) {
        this.chineseScore = chineseScore;
    }

    /**
     * 获取
     * @return mathScore
     */
    public int getMathScore() {
        return mathScore;
    }

    /**
     * 设置
     * @param mathScore
     */
    public void setMathScore(int mathScore) {
        this.mathScore = mathScore;
    }

    /**
     * 获取
     * @return englishScore
     */
    public int getEnglishScore() {
        return englishScore;
    }

    /**
     * 设置
     * @param englishScore
     */
    public void setEnglishScore(int englishScore) {
        this.englishScore = englishScore;
    }

    public String toString() {
        return "Student{name = " + name + ", age = " + age + ", chineseScore = " + chineseScore + ", mathScore = " + mathScore + ", englishScore = " + englishScore + ", sum = " + (chineseScore + mathScore + englishScore) + "}";
    }

//    @Override
//    public int compareTo(Student o) {
//        int sum1 = this.chineseScore + this.mathScore + this.englishScore;
//        int sum2 = o.chineseScore + o.mathScore + o.englishScore;
//        int i = sum1 - sum2;
//        i = i == 0 ? this.chineseScore - o.chineseScore : i;
//        i = i == 0 ? this.mathScore - o.mathScore : i;
//        i = i == 0 ? this.age - o.getAge() : i;
//        i = i == 0 ? this.name.compareTo(o.getName()) : i;
//        return i;
//    }
}
